package com.keeley.util;

import java.io.InputStream;
import java.util.Properties;


public class PropertiesUtil {
    private static InputStream inputStream =
            PropertiesUtil.class.getClassLoader().getResourceAsStream("config.txt");
    private static Properties p = new Properties();
    static{
        try {
            p.load(inputStream);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 获取资源文件value值
     * @param properName
     * @return
     */
    public static String get(String properName) {
        return p.getProperty(properName);
    }

    /**
     * 此类不能被实例化
     */
    private PropertiesUtil(){

    }

    public static void main(String[] args) {
        System.out.println(PropertiesUtil.get("jdbcUrl"));

    }
}
